package com.example.fu3.config;

import com.example.fu3.inceptor.AuthInterceptor;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@Configuration
public class AuthInterceptorConfig implements WebMvcConfigurer {
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(new AuthInterceptor())
                .addPathPatterns("/**")
                .excludePathPatterns("/user/login","/doc.html","/swagger-ui.html"
                        ,"/webjars/**","/swagger-resources",
                        "/swagger-resources/**","/v2/**");// 登录接口是不要验证token的
    }
}
